home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
011-020
/
amok16
/
memsystem
/
taskmemory.def
< prev
next >
Wrap
Text File
|
1993-11-04
|
2KB
|
53 lines
(**********************************************************************
:Program. TaskMemory.def
:Contents. Allocation procedures using the Task.memEntry-list
:Author. Nicolas Benezan [bne]
:Address. Postwiesenstr. 2, D7000 Stuttgart 60
:Phone. 711/333679
:Copyright. Public Domain
:Language. Modula-2
:Translator. M2Amiga AMSoft 3.11
:History. V1.0 [bne] 12.Jan.89 (extracted from MemSystem1.1)
:Bugs. does not handle Arts-levels perfectly if CLI-started
:Bugs. (however, no serious malfunctions should occur)
(don't worry, be happy !)
**********************************************************************)
DEFINITION MODULE TaskMemory;
FROM SYSTEM IMPORT ADDRESS;
FROM Exec IMPORT MemReqSet,MemReqs;
CONST CHIP=MemReqSet{chip,memClear};
ANY=MemReqSet{memClear};
(* - fully reentrable
- TermProcedure at level 0 only *)
PROCEDURE AllocTaskMem(byteSize:LONGINT;requirements:MemReqSet):ADDRESS;
(*:Semantic. Allocates memory and appends an entry to the
:Semantic. memEntry-list of the task
:Note. parameter compatible with Exec.AllocMem()
:Note. Take GREAT CARE with PUBLIC Memory (shared by tasks)!!!
:Note. All Memory allocated by TaskMem() will be lost when
:Note. you call RemTask(). So be careful with public
:Note. MsgPorts ! (Big guru is watching you) *)
PROCEDURE DeallocTaskMem(VAR Pointer:ADDRESS);
(*:Input. Pointer: Address of the memory to be deallocated
:Output. Pointer is set to NIL
:Semantic. Deallocates Memory blocks allocated with
:Semantic. stem.Allocate() or MemSystem.AllocMem() *)
(**)
(* The following procedures are included to be compatible with Heap *)
(**)
PROCEDURE AllocMem(VAR adr:ADDRESS;size:LONGINT;chipMem:BOOLEAN);
PROCEDURE Allocate(VAR adr:ADDRESS;size:LONGINT);
PROCEDURE Deallocate(VAR adr:ADDRESS);
END TaskMemory.